package com.mi.system.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.mi.system.dto.query.UserQueryDTO;
import com.mi.system.entity.User;
import com.mi.system.vo.UserVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * User mapper
 *
 * @author jin_huaquan
 * @version 1.0
 * @date 2021/11/1 13:50
 */
@Mapper
public interface UserMapper extends BaseMapper<User> {

    /**
     * list user
     *
     * @param page  page info
     * @param query query params
     * @return user list
     */
    Page<UserVO> selectByPage(Page page, @Param("query") UserQueryDTO query);

    /**
     * select user
     *
     * @param query query params
     * @return user list
     */
    List<UserVO> selectByQuery(@Param("query") UserQueryDTO query);

    /**
     * get user
     *
     * @param username username
     * @return user info
     */
    UserVO selectByUsername(@Param("username") String username);
}
